package main

import (
	"fmt"
	"io/ioutil"
	"os"
)

func main() {

	p, _ := os.Getwd()

	var fpath string
	if len(os.Args) == 1 {
		fpath = p + ""
	} else {
		fpath = p + "/" + os.Args[1]
	}
	s, err := os.Stat(fpath)

	if err != nil {
		println(err.Error())
		return
	} else {
		fmt.Println("     文件名        修改时间")
		if s.IsDir() {
			dir, _ := ioutil.ReadDir(fpath)
			for _, fi := range dir {
				var dirFlag string
				if fi.IsDir() {
					dirFlag = "+"
				} else {
					dirFlag = "-"
				}
				fmt.Printf("%s    %s       %s\n", dirFlag, fi.Name(), fi.ModTime())
			}
		}

	}
}
